// Copyright Epic Games, Inc. All Rights Reserved.

#include "ISmartMenuModule.h"
//#include "SmartSettings.h"
#include "SmartUIManager.h"

#include "ISettingsModule.h"
#include "ISettingsSection.h"

#define LOCTEXT_NAMESPACE "SmartMenu"

class FSmartMenuModule : public ISmartMenuModule
{
public:
	virtual void StartupModule() override
	{
		if (GIsEditor && !IsRunningCommandlet())
		{
			//RegisterSettings();

			FSmartUIManager::Initialize();
		}
	}
	// USkeleton
	virtual void ShutdownModule() override
	{
		if ((GIsEditor && !IsRunningCommandlet()))
		{
			FSmartUIManager::Shutdown();

			//UnregisterSettings();
		}
	}

protected:
	//void RegisterSettings()
	//{
	//	ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
	//	if (SettingsModule != nullptr)
	//	{
	//		ISettingsSectionPtr SettingsSection = SettingsModule->RegisterSettings("Project", "Plugins", "Smart",
	//			LOCTEXT("SmartSettingsName", "Smart"),
	//			LOCTEXT("SmartSettingsDescription", "Configure the Smart plug-in."),
	//			GetMutableDefault<USmartSettings>()
	//		);
	//	}
	//}

	//void UnregisterSettings()
	//{
	//	ISettingsModule* SettingsModule = FModuleManager::GetModulePtr<ISettingsModule>("Settings");
	//	if (SettingsModule != nullptr)
	//	{
	//		SettingsModule->UnregisterSettings("Project", "Plugins", "Smart");
	//	}
	//}
};

IMPLEMENT_MODULE(FSmartMenuModule, Smart);

#undef LOCTEXT_NAMESPACE
